import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import "@/assets/iconfont/iconfont.css";
import "@/assets/iconfont/font/iconfont.css";
import * as echarts from "echarts";
// 引入全局守卫
import "./router/permission.js";
// 引入i18n
import VueI18n from "vue-i18n";

Vue.config.productionTip = false;
Vue.use(ElementUI);
// 将echarts挂载到vue的根节点
Vue.prototype.$echarts = echarts;
// 使用
Vue.use(VueI18n);
// 创建I18n实例
const i18n = new VueI18n({
  locale: store.getters.locale,
  messages: {
    zh: require("./lang/zh"),
    en: require("./lang/en"),
  },
});

// 注册
new Vue({
  i18n,
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");
